package main

import (
	poker "learn-go-with-tests/ch15"
	"log"
	"net/http"
)

const dbFileName = "./ch15/game.db.json"

func main() {
	store, err := poker.NewFileSystemPlayerStore(dbFileName)
	if err != nil {
		log.Fatalf("problem creating file system player store, %v ", err)
	}
	server := poker.NewPlayerServer(store)

	if err := http.ListenAndServe(":5000", server); err != nil {
		log.Fatalf("could not listen on port 5000 %v", err)
	}
}
